package com.brainhealth.customer.service.impl;

import java.util.List;

import com.brainhealth.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.brainhealth.customer.mapper.ChatRecordMapper;
import com.brainhealth.customer.domain.ChatRecord;
import com.brainhealth.customer.service.IChatRecordService;

/**
 * 会员聊天Service业务层处理
 *
 * @author ruoyi
 * @date 2023-05-30
 */
@Service
public class ChatRecordServiceImpl implements IChatRecordService {
    @Autowired
    private ChatRecordMapper chatRecordMapper;

    /**
     * 查询会员聊天
     *
     * @param id 会员聊天主键
     * @return 会员聊天
     */
    @Override
    public ChatRecord selectChatRecordById(Long id) {
        return chatRecordMapper.selectChatRecordById(id);
    }

    /**
     * 查询会员聊天列表
     *
     * @param chatRecord 会员聊天
     * @return 会员聊天
     */
    @Override
    public List<ChatRecord> selectChatRecordList(ChatRecord chatRecord) {
        return chatRecordMapper.selectChatRecordList(chatRecord);
    }

    @Override
    public ChatRecord selectChatRecord(ChatRecord chatRecord) {
        return chatRecordMapper.selectChatRecord(chatRecord);
    }

    @Override
    public List<String> selectCustomerIdList() {
        return  chatRecordMapper.selectCustomerIdList();
    }

    @Override
    public List<String> selectRecordIdList(Long customerId) {
        return chatRecordMapper.selectRecordIdList(customerId);
    }

    /**
     * 新增会员聊天
     *
     * @param chatRecord 会员聊天
     * @return 结果
     */
    @Override
    public int insertChatRecord(ChatRecord chatRecord) {
        chatRecordMapper.insertChatRecord(chatRecord);
        return chatRecord.getId().intValue();
    }

    /**
     * 修改会员聊天
     *
     * @param chatRecord 会员聊天
     * @return 结果
     */
    @Override
    public int updateChatRecord(ChatRecord chatRecord) {
        return chatRecordMapper.updateChatRecord(chatRecord);
    }

    /**
     * 批量删除会员聊天
     *
     * @param ids 需要删除的会员聊天主键
     * @return 结果
     */
    @Override
    public int deleteChatRecordByIds(Long[] ids) {
        return chatRecordMapper.deleteChatRecordByIds(ids);
    }

    /**
     * 删除会员聊天信息
     *
     * @param id 会员聊天主键
     * @return 结果
     */
    @Override
    public int deleteChatRecordById(Long id) {
        return chatRecordMapper.deleteChatRecordById(id);
    }
}
